
import request from '@/axios'

export class defaultApi {
    // k线图数据
    static clkline(params) {
        return request.postAndLoadData('/stock/clkline', params)
    }
    // 分时数据
    static rtData(params) {
        return request.postAndLoadData('/rt_data', params)
    }
    // 查询代码名称
    static searchCode(params) {
        return request.getAndLoadData('/search_code', params)
    }
    // 股票/指数列表
    static codeList(params) {
        return request.getAndLoadData('/code_list', params)
    }
    // 标的详情
    static codeDetail(params) {
        return request.getAndLoadData('/code_detail', params)
    }
    // 标的摆盘（买卖5）
    static orderBook(params) {
        return request.getAndLoadData('/order_book', params)
    }
    // 所属板块信息
    static plate(params) {
        return request.getAndLoadData('/stock/plate', params)
    }
    // 自选操作
    static opt(params) {
        return request.postAndLoadData('/zixuan/opt', params)
    }
    // 自选列表
    static stocks(params) {
        return request.getAndLoadData('/zixuan/stocks', params)
    }
    // 逐笔列表
    static rtTicker(params) {
        return request.getAndLoadData('/rt_ticker', params)
    }
    // 风险提示
    static risk(params) {
        return request.getAndLoadData('/other/risk', params)
    }
    // 策略选股
    static chooseStocks(params) {
        return request.getAndLoadData('/stock/choose_stocks', params)
    }
    // 板块股票列表(列表结构同标的详情)
    static plateStocks(params) {
        return request.get('/plate_stocks', params)
    }
    // 板块列表
    static plateList(params) {
        return request.getAndLoadData('/plate_list', params)
    }
}
// 登录/注册
export class userApi {
    // 注册
    static registration(params) {
        return request.postAndLoadData('/dj-rest-auth/registration/', params)
    }
    // 登录
    static login(params) {
        return request.postAndLoadData('/dj-rest-auth/login/', params)
    }
    // 当前用户
    static user(params) {
        return request.getAndLoadData('/dj-rest-auth/user/', params)
    }
    // 刷新token
    static refresh(params) {
        return request.postAndLoadData('/dj-rest-auth/token/refresh/', params)
    }
}
// 会员
export class vipApi {
    // 会员包
    static packages(params) {
        return request.getAndLoadData('/member/api/v1/vip/packages', params)
    }
    // 会员信息
    static info(params) {
        return request.getAndLoadData('/member/api/v1/vip/info', params)
    }
}